package by.msokoloff.javaweb2015.datamodel;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

@Entity
@Table(name = "country")
public class Country extends AbstractEntity {

	@Column(name = "iso_code", unique = true, nullable = false)
	@NotNull
	@Size(min = 2, max = 2)
	private String isoCode;

	@Column(name = "name", nullable = false)
	@NotNull
	private String name;

	public String getIsoCode() {
		return isoCode;
	}

	public void setIsoCode(String isoCode) {
		this.isoCode = isoCode;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Override
	public String toString() {
		return "[Country: " + this.name + "]";
	}
}
